#ifndef BASE_WINDOWPICKERFACTORY_H_
#define BASE_WINDOWPICKERFACTORY_H_

#if defined(WIN32)
#include "win32windowpicker.h"
#elif defined(OSX)
#include "macutils.h"
#include "macwindowpicker.h"
#elif defined(LINUX)
#include "linuxwindowpicker.h"
#endif

#include "windowpicker.h"

namespace base {

	class WindowPickerFactory {
	public:
		virtual ~WindowPickerFactory() {}

		// Instance method for dependency injection.
		virtual WindowPicker* Create() {
			return CreateWindowPicker();
		}

		static WindowPicker* CreateWindowPicker() {
#if defined(WIN32)
			return new Win32WindowPicker();
#elif defined(OSX)
			return new MacWindowPicker();
#elif defined(LINUX)
			return new LinuxWindowPicker();
#else
			return NULL;
#endif
		}

		static bool IsSupported() {
#ifdef OSX
			return GetOSVersionName() >= kMacOSLeopard;
#else
			return true;
#endif
		}
	};

}  // namespace base

#endif  // BASE_WINDOWPICKERFACTORY_H_
